package com.ews.onlineexchange.service;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

@Entity
@Table(name = "T_SENDTASK")
public class ShortMessage {
	private Long		taskId;
	private String		content;
	private String		destNumber;
	private int			validMinute	= 10;
	private int			sendFlag	= 0;
	private String		signName = "" ;
	private String 		feedbackMsg = "";
	private Date		sendTime = new Date();
	private String 		templateCode;
	private String		params;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator="sendTaskGen")
	@SequenceGenerator(name="sendTaskGen",allocationSize=1, sequenceName="SEQ_SHORTMESSAGE")
	public Long getTaskId() {
		return taskId;
	}

	public void setTaskId(Long taskId) {
		this.taskId = taskId;
	}

	@Length(max = 2048)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Length(max = 32)
	@NotNull
	public String getDestNumber() {
		return destNumber;
	}

	public void setDestNumber(String destNumber) {
		this.destNumber = destNumber;
	}

	public int getValidMinute() {
		return validMinute;
	}

	public void setValidMinute(int validMinute) {
		this.validMinute = validMinute;
	}

	public int getSendFlag() {
		return sendFlag;
	}

	public void setSendFlag(int sendFlag) {
		this.sendFlag = sendFlag;
	}

	public String getSignName() {
		return signName;
	}

	public void setSignName(String signName) {
		this.signName = signName;
	}

	public ShortMessage() {}
	
	
	@Temporal(TemporalType.TIMESTAMP)
	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public ShortMessage(String destNumber, String content) {
		super();
		this.content = content;
		this.destNumber = destNumber;
	}
	
	public ShortMessage(String content, String destNumber, String templateCode, String params) {
		super();
		this.content = content;
		this.destNumber = destNumber;
		this.templateCode = templateCode;
		this.params = params;
	}

	public ShortMessage(String destNumber, String templateCode, String params) {
		super();
		this.destNumber = destNumber;
		this.templateCode = templateCode;
		this.params = params;
	}
	
	@Length(max = 4000)
	public String getFeedbackMsg() {
		return feedbackMsg;
	}

	public void setFeedbackMsg(String feedbackMsg) {
		this.feedbackMsg = feedbackMsg;
	}

	public String getTemplateCode() {
		return templateCode;
	}

	public void setTemplateCode(String templateCode) {
		this.templateCode = templateCode;
	}
	
	@Length(max = 4000)
	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}
	
	
	
}
